package com.hskn.hss.utils;

import java.util.List;
import java.util.Map;

public class ArrayUtil {
    public String join(String[] array){
        if(array.length==0) return "";
        StringBuilder str = new StringBuilder(array[0]);
        for(int i=1;i<array.length;i++){
            str.append(",").append(array[i]);
        }
        return str.toString();
    }

    public String join(List<Map<String,String>> list, String key){
        if(list.size()==0) return "";
        StringBuilder str = new StringBuilder(list.get(0).get(key));
        for(int i=1;i<list.size();i++){
            str.append(",").append(list.get(i).get(key));
        }
        return str.toString();
    }
}
